<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>CSS 美化表格</title>

  <style>
    .demo {
      width: 600px;
      margin: 40px auto;
      font-family: 'trebuchet MS', 'Lucida sans', Arial;
      font-size: 14px;
      color: #444;
    }

    table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
    }


    table thead tr,
    table tbody tr {
      height: 50px;
      line-height: 50px;
    }

    table th,
    table td {
      padding-left: 10px;
      padding-right: 10px;
      border: 1px solid #444444;
      text-align: center;
    }

    table tr th:first-child,
    table tr td:first-child {
      border-left: 2px solid #444;
    }

    table tr th:last-child,
    table tr td:last-child {
      border-right: 2px solid #444;
    }

    table tr th {
      background: #444;
      color: white;
    }

    table tr:first-child th:first-child {
      border-top-left-radius: 12px;
    }

    table tr:first-child th:last-child {
      border-top-right-radius: 12px;
    }

    table tr:last-child td:first-child {
      border-bottom-left-radius: 12px;
    }

    table tr:last-child td:last-child {
      border-bottom-right-radius: 12px;
    }

    table tr:hover td {
      background-color:sandybrown;
      color: #fff;
      border: 1px solid #fff;
    }
  </style>
</head>

<body>
  <div class="demo">
    <table class="bordered-table">
      <thead>
        <tr>
          <th>#</th>
          <th>IMDB Top 10 Movies</th>
          <th>Year</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>1</td>
          <td>The Shawshank Redemption</td>
          <td>1906</td>
        </tr>
        <tr>
          <td>2</td>
          <td>The Godfather</td>
          <td>1766</td>
        </tr>
        <tr>
          <td>3</td>
          <td>The Godfather: Part II</td>
          <td>1926</td>
        </tr>
        <tr>
          <td>4</td>
          <td>The Good, the Bad and the Ugly</td>
          <td>1966</td>
        </tr>
      </tbody>
    </table>
  </div>
</body>

</html>